Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

136
Visualizações
PowerBI Embedded API: "too few fields" error when trying to export data

I'm using the Power Bi Embedded API to show reports to my users in a web application.

The API has an exportData() method that is designed to export either the full data or the summarized data from a visual in the report.

My problem occurs when trying to export the summarized data:

myVisual.exportData(ExportDataType.Summarized);

when I do this, this is what I get back:

enter image description here

As you can see, the returned data has a TooFewFields error, with the message Too few fields: expected 3 fields but parsed 1.

Can anyone explain what this error means, and why it is happening? I tried googling, but didn't find anything regarding this particular error.

Note that:

  • Exporting the full data, instead of the summarized one, works correctly
  • Exporting the summarized data from the UI (by clicking export data in the top right corner of the visual) works correctly
  • This seems to happen on all visuals in the report
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The "TooFewFields" error occurred because, The ‘exportData()’ method mainly consists of 2 parameters Namely Summarized Datatype and Count of Rows to be returned. But the code that you have written does not consist the parameter as expected. You have to include Models. Exportdatatype. Summarized and the row count to get the required result.

Find the below code snippet:

1.Get the page which contains visual:

    const pages = await report. getPages();
    let page = pages.filter(function (page) { 
        return page.isActive 
    })[0]; 
    const visuals = await page.getVisuals(); 

2 Find the target visual:

    let visual = visuals.filter(function (visual) { 
        return visual.name === "Required_Visual_Name"; 
    })[0]; 

3.Export data from visual:

    const result = await visual.exportData(models.ExportDataType.Summarized,100); 
    console.log(result.data); 

Output:

enter image description here

Please find the reference here for exporting summarized data: https://docs.microsoft.com/javascript/api/overview/powerbi/export-data

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda